for i in range(9):
    if i//3 == 1:
        line='* '*3+'  '*3+'* '*3
    else:
        line='* '*9
    print(line,end=' '*5)
    if i in (0,8):
        line='* '*9
    elif i in (1,7):
        line='*'+' '*15+'*'
    elif i in (2,6):
        line='*'+' '*3+'* '*5+' '*2+'*'
    else:
        line='*'+' '*3+'*'+' '*7+'*'+' '*3+'*'
    print(line)
